package com.wc.acwing.思维.FEB;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congege
 * @Description FEB
 * https://www.acwing.com/problem/content/4996/
 * @Date Created in 2023/12/22-17:44
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int n;
    static String s;

    public static void main(String[] args) {
        n = sc.nextInt();
        s = sc.nextLine();
        char B = 'B', E = 'E', F = 'F';
        char[] chs1 = s.toCharArray();
        char[] chs2 = s.toCharArray();
        boolean flg = true;
        for (int i = 0; i < n; i++) {
            if (chs1[i] != F) {
                flg = false;
                break;
            }
        }
        int low = 0, high = 0, d;
        if (flg) {
            high = n - 1;
            d = 1;
            out.println(n);
            for (int i = low; i <= high; i += d) {
                out.println(i);
            }
        } else {
            int L = 0, R = n - 1;
            while (chs1[L] == 'F') {
                L++;
            }
            while (chs1[R] == 'F') {
                R--;
            }
            // 计算最小值
            for (int i = L; i <= R; i++) {
                if (chs1[i] == F) {
                    if (chs1[i - 1] == E) {
                        chs1[i] = B;
                    } else {
                        chs1[i] = E;
                    }
                    chs2[i] = chs2[i - 1];
                }
                if (i > L && chs1[i] == chs1[i - 1]) {
                    low++;
                }
                if (i > L && chs2[i] == chs2[i - 1]) {
                    high++;
                }
            }
            int q = L + n - R - 1;
            d = 2;
            if (q != 0) {
                d = 1;
                high += q;
            }
            // 个数
            out.println((high - low) / d + 1);
            for (int i = low; i <= high; i += d) {
                out.println(i);
            }
        }

        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }



    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }
}